/**

	Bitfield.h
	==========
	
	Little endian dynamic bitfield header
	
**/

#ifndef BITFIELD_H
#define BITFIELD_H

/**

	Includes
	========
	
	- stdint.h		: uint8_t
	
**/

#include <stdint.h>


/**

	Structure: struct bitfield
	--------------------------
	
	Members are:
	- bits	: bit array
	- n	: bit count
	
**/

struct bitfield
{
	uint8_t* bits;
	uint16_t n;
};


/**

   Prototypes
   ----------

**/

int bf_set(struct bitfield* bf, uint16_t n);
int bf_unset(struct bitfield* bf, uint16_t n);
uint8_t bf_isset(struct bitfield* bf, uint16_t n);
struct bitfield* bf_create(struct bitfield* clone);
void bf_delete(struct bitfield* bf);
int bf_compare(struct bitfield* bf1,struct bitfield* bf2);

#endif
